@(comment: gitbucket.core.model.CommitComment,
  hasWritePermission: Boolean,
  repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
  latestCommitId: Option[String] = None)(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
<div class="commit-comment-box @if(latestCommitId.contains(comment.commitId)){inline-comment}" id="discussion_r@comment.commentId"
  @if(comment.fileName.isDefined){filename="@comment.fileName.get"}
  @if(comment.newLine.isDefined){newline="@comment.newLine.get"}
  @if(comment.oldLine.isDefined){oldline="@comment.oldLine.get"}>
  <div class="commit-comment-@comment.commentId">
    <div class="markdown-body">
      <div>
        @helpers.avatarLink(comment.commentedUserName, 20)
        @helpers.user(comment.commentedUserName, styleClass="username strong")
        <span class="muted">@gitbucket.core.helper.html.datetimeago(comment.registeredDate)</span>
        <span class="pull-right">
        @if(hasWritePermission || context.loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false)){
          <a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil" aria-label="Edit"></i></a>&nbsp;
          <a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x" aria-label="Remove"></i></a>
        }
        </span>
      </div>
      <div class="commit-commentContent-@comment.commentId">
        @helpers.markdown(
          markdown           = comment.content,
          repository         = repository,
          branch             = repository.repository.defaultBranch,
          enableWikiLink     = false,
          enableRefsLink     = true,
          enableLineBreaks   = true,
          enableTaskList     = true,
          hasWritePermission = hasWritePermission
        )
      </div>
    </div>
  </div>
</div>
